package greate.project.quartz.job;

import lombok.extern.slf4j.Slf4j;
import org.quartz.*;


@Slf4j
public class DemoJob implements Job {


    @Override
    public void execute(JobExecutionContext context) {

        // 任务详情
        final JobDetail jobDetail = context.getJobDetail();


        // JobDetail 里面的暂存数据（可以用来传递数据）
        final JobDataMap jobDataMap = jobDetail.getJobDataMap();
        final JobKey key = jobDetail.getKey();
        final String description = jobDetail.getDescription();


        log.info("JobDetail jobDataMap 中的数据: {}", jobDataMap);
        log.info("JobDetail key: {}", key);
        log.info("JobDetail description: {}", description);

    }

}
